<template>
  <el-card class="box-card">
    <template #header>
      <div class="card-header">
        <span>待处理订单</span>
        <el-button type="primary" link class="button" @click="toOrderList">去处理</el-button>
      </div>
    </template>
    <el-table :data="list" style="width: 100%;">
      <el-table-column label="订单编号" prop="codeOr" min-width="130">
      </el-table-column>
      <el-table-column label="商品数量" prop="itemNum" width="85" align="center">
      </el-table-column>
      <el-table-column label="下单时间" prop="dtOr" width="150" align="center">
        <template #default="scope">
          {{ parseTime(scope.row.dtOr, '{y}-{m}-{d} {h}:{i}') }}
        </template>
      </el-table-column>
    </el-table>
  </el-card>
</template>

<script setup>
import {parseTime} from "@/utils/ruoyi";
import {toRefs, reactive, onBeforeMount} from 'vue'
import useUserStore from "@/store/modules/user";

const userStore = useUserStore();

const state = reactive({
  list: []
})
onBeforeMount(() => {
  fetchData()
})
const statusFilter = (status) => {
  const statusMap = {
    success: 'success',
    pending: 'danger'
  }
  return statusMap[status]
}
const toThousandFilter = (num) => {
  return (+num || 0).toString().replace(/^-?\d+/g, (m) => m.replace(/(?=(?!\b)(\d{3})+$)/g, ','))
}
const orderNoFilter = (str) => {
  return
}
const fetchData = () => {
  const queryParam = {
    pageNum: 1,
    pageSize: 20,
    idClob: undefined
  }
}
const {proxy} = getCurrentInstance();
const toOrderList = () => {
  proxy.$router.push({ path: "/order/list" });
}
//导出属性到页面中使用
let {list} = toRefs(state)
</script>

<style scoped lang="scss">
.el-table {
  :deep(.cell) {
    padding: 0 6px !important;
  }
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

</style>
